package com.exam.hibuy.service.impl;

import com.exam.hibuy.mapper.UserMapper;
import com.exam.hibuy.model.User;
import com.exam.hibuy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by admin on 2017/12/1.
 */
@Service("userService")
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectByUsername(String username) {
        return userMapper.findUserByUserName(username);
    }

    @Override
    public List<User> findUsers() {
        return userMapper.findUsers();
    }
}
